package com.qqtech.qquan.send.model;

import java.util.List;

import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;

import com.qqtech.core.common.util.TimeUtil;
import com.qqtech.qquan.send.enums.SendDeliveryOrderPickupStatusDictEnum;
import com.qqtech.qquan.send.enums.SendDeliveryOrderStatusDictEnum;

@SuppressWarnings("serial")
public class SendDeliveryOrderVo extends SendDeliveryOrder{
	
	/** 明细 */
	public List<SendDeliveryOrderItemVo> itemList;
	
	/**
	 * 买家昵称
	 */
	private String userNick;
	/**
	 * 社区名称
	 */
	private String communityName;
	
	/** 订单名称,orderBase的title */
	private String orderTitle;
	
	public String getOrderTitle() {
		return orderTitle;
	}

	public void setOrderTitle(String orderTitle) {
		this.orderTitle = orderTitle;
	}
	
	public String getUserNick() {
		return userNick;
	}

	public void setUserNick(String userNick) {
		this.userNick = userNick;
	}

	public List<SendDeliveryOrderItemVo> getItemList() {
		return itemList;
	}

	public void setItemList(List<SendDeliveryOrderItemVo> itemList) {
		this.itemList = itemList;
	}
	
	public String getStrDeliveryStatus() {
		if (getDeliveryStatus() == null) {
			return "";
		} else if (getDeliveryStatus().intValue() == SendDeliveryOrderStatusDictEnum.NOTDELIVERY.getCode()) {
			return "未配送";
		} else {
			return "已配送";
		}
	}
	
	public String getStrPickupStatus() {
		if (getPickupStatus() == null) {
			return "";
		} else if (getPickupStatus().intValue() == SendDeliveryOrderPickupStatusDictEnum.NOTPICKUP.getCode()) {
			return "未取件";
		} else {
			return "已取件";
		}
	}
	
	public String getStrId() {
		if (getId() == null) {
			return "";
		}
		return getId().toString();
	}
	
	public String getStrDeliveryAt() {
		return TimeUtil.getStringTimeByFormat(getDeliveryAt(), "yyyy-MM-dd HH:mm");
	}
	
	public String getStrPickupAt() {
		return TimeUtil.getStringTimeByFormat(getPickupAt(), "yyyy-MM-dd HH:mm");
	}

	@Override
	public String toString() {
		return ToStringBuilder.reflectionToString(this,
				ToStringStyle.MULTI_LINE_STYLE);
	}

	public String getCommunityName() {
		return communityName;
	}

	public void setCommunityName(String communityName) {
		this.communityName = communityName;
	}

}